package phapp.service.barapp.impl;

import static javacommon.util.Struts2JsonHelper.outJson;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import cn.org.rapid_framework.page.Page;
import cn.org.rapid_framework.page.PageRequest;
import javacommon.base.*;

import phapp.model.barapp.*;
import phapp.dao.barapp.*;
import phapp.service.barapp.impl.*;
import phapp.service.barapp.*;
/**
 * <p> 标题: 酒吧聊天日志表, tc_bar_chat_log_info  业务处理层
 * <p>Description: spring事务实现层,调用Dao层取数据
 * <p>Copyright: Copyright (c) 2014-10
 * <p>Company: 
 * @see phapp.model.barapp.BarChatLog
 * @see phapp.service.barapp.BarChatLogManager
 * @see phapp.dao.barapp.BarChatLogDao
 * @author you name
 * @version 1.0
*/

@Component("barChatLogManager")
@Transactional
public class BarChatLogManagerImpl extends BaseManager<BarChatLog,java.lang.Integer>
               implements BarChatLogManager {

   /**定义Dao*/
   private BarChatLogDao barChatLogDao;
   /**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性*/
   public void setBarChatLogDao(BarChatLogDao dao) {
      this.barChatLogDao = dao;
   }

   /**获取Dao*/
   public EntityDao getEntityDao() {
      return this.barChatLogDao;
   }

   /**
   * <p>分页查询BarChatLog<br>
   * @param PageRequest pr
   * @return Page 
   */
   @Transactional(readOnly=true)
   public Page findByPageRequest(PageRequest pr) {
      return barChatLogDao.findByPageRequest(pr);
   }

   /**
   * <p>批量删除 BarChatLog<br>
   * @param BarChatLog u
   * @return Boolean 
   */
   public Boolean  removeByIdArry(BarChatLog u) {
      Boolean result =false;
      int i =-1,size=u.getIdList().size();
      i =barChatLogDao.removeByIdArry(u);
      if(i==size){
         result =true;
      }else{
         throw new RuntimeException();
      }
      return result;
   }
	/**
	* <p> Bean查询 <br> 
	* @param BarChatLog bean
	* @return  BarChatLog 
	*/

	/**
	* <p>按Bean查询返回List<br> 
	* @param BarChatLog bean
	* @return List 
	*/
	public java.util.List  findListByBean(BarChatLog u) { 
		java.util.List<BarChatLog> list =  barChatLogDao.findListByBean(u); 
	      return list;
	}
    /**
     * <p>标题: 最近联系人
     * <p>参数: String menberId 会员ID,String limit 取前多少条 ,String control 1:查好友,2:取非好友, String reading 已读未读:1已读,2未读
     * <p>描述: 以字母排序列表
     * <p>返回: {"list":[{BarChatLog}]
     * @see phapp.model.barapp.BarChatLog
     */
    public List  getSoonFriendList(java.util.Map map) { 
    	List<BarChatLog> list = barChatLogDao.getSoonFriendList(map);
    	return list;
    }
 	/**
 	 * <p>通过 Map 修改一条 数据<br> 
 	 * @param  java.util.Map 
 	*/
    public int updateByMap(java.util.Map map){
    		int count = barChatLogDao.updateByMap(map);
    		return count;
    }
    
}
